﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


namespace Nirvana
{
    /// <summary>
    /// toggle控制伸缩、展开组件,配合AccordionElement脚本作缓动动画
    /// </summary>
    [RequireComponent(typeof(ContentSizeFitter))]
    [RequireComponent(typeof(VerticalLayoutGroup))]
    [RequireComponent(typeof(ToggleGroup))]
    [AddComponentMenu("Nirvana/UI/Control/Accordion")]
    public class Accordion : MonoBehaviour
    {
        public enum Transition
        {
            Instant,
            Tween
        }
        [Tooltip("The transition type.")]
        [SerializeField]
        private Transition transitionType;
        [Tooltip("The transition duration.")]
        [SerializeField]
        private float duration = 0.3f;

        public Transition TransitionType
        {
            get
            {
                return this.transitionType;
            }
            set
            {
                this.transitionType = value;
            }
        }

        public float TransitionDuration
        {
            get
            {
                return this.duration;
            }
            set
            {
                this.duration = value;
            }
        }





    }
}

